package demo;
public class TestAnimal {
    public void eat(Animal animal) {
        animal.eat();
    }

    public void main(String[] args) {
        Animal dog = new Dog("旺财");
        Cat cat = new Cat("小咪");
        eat(dog);
        eat(cat);
    }
}